package com.bifang.common.vo;

import io.swagger.annotations.ApiModelProperty;
import java.io.Serializable;
import java.util.List;
import lombok.Data;

/**
 * excel表头实体
 *
 * @author chenzh04
 * @date 2018-5-17
 */
@Data
public class ExcelFieldVO implements Serializable {
    /** 第几列 */
    @ApiModelProperty(value = "第几列")
    private Integer index;
    /** 对应数据字段key * */
    @ApiModelProperty(value = "对应数据字段key")
    private String key;

    /** 表头标题 * */
    @ApiModelProperty(value = "表头标题")
    private String title;

    /** 对应数据父字段key * */
    @ApiModelProperty(value = "对应数据父字段key")
    private String parentKey;

    /** 宽度 * */
    @ApiModelProperty(value = "宽度")
    private Short width;

    @ApiModelProperty(value = "头部字体颜色")
    private Short headerColor;

    @ApiModelProperty(value = "数据字体颜色")
    private Short bodyColor;

    @ApiModelProperty(value = "头部背景颜色")
    private Short headerBgColor;

    @ApiModelProperty(value = "字体背景颜色")
    private Short bodyBgColor;

    @ApiModelProperty(value = "是否换行")
    private Boolean wrapText;

    @ApiModelProperty(value = "字体大小")
    private Short fontSize;

    @ApiModelProperty(value = "字体")
    private String fontName;

    @ApiModelProperty(value = "边框粗细 0-13")
    private Short borderSize;

    @ApiModelProperty(value = "边框颜色 0-64")
    private Short borderColor;

    /** 合并 是否需要赋值 * */
    @ApiModelProperty(value = "合并 是否需要赋值")
    private Boolean setFlag;
    /** 合并行 开始 * */
    @ApiModelProperty(value = "合并行 开始")
    private Integer startRow;
    /** 合并行 结束 * */
    @ApiModelProperty(value = "合并行 结束")
    private Integer endRow;
    /** 合并列 开始 * */
    @ApiModelProperty(value = "合并列 开始")
    private Integer startColumn;
    /** 合并列 结束 * */
    @ApiModelProperty(value = "合并列 结束")
    private Integer endColumn;
    /** 类型 */
    @ApiModelProperty(value = "类型")
    private String cellType = CellTypeEnum.DEFAULT.getType();
    /** 下拉值 */
    @ApiModelProperty(value = "下拉值")
    private List<SelectVO> codeList;

    @ApiModelProperty(value = "下级表头")
    private List<ExcelFieldVO> children;

    public enum CellTypeEnum {
        DEFAULT("default", "常规"),
        TEXT("text", "文本"),
        NUMBER("number", "数字"),
        NUMBER2("number2", "两位小数"),
        DATE("date", "日期到日"),
        DATETIME("datetime", "日期到秒"),
        SELECT("select", "单选下拉框"),
        MULTIPLESELECT("multiple-select", "多选下拉框"),
        CASCADERSELECT("cascader-select", "联级下拉框");
        private String type;
        private String desc;

        CellTypeEnum(String type, String desc) {
            this.type = type;
            this.desc = desc;
        }

        public String getType() {
            return type;
        }
    }
}
